package de.voichie.android.cipher;

import de.voichie.android.cipher.R;
import de.voichie.android.cipher.activities.DecryptActivity;
import de.voichie.android.cipher.activities.EncryptActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
//      --- Encryption Activity --------
        findViewById(R.id.btnCipherPassword).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                cipherPassword();
            }
        });
        
//      --- Decryption Activity --------
        findViewById(R.id.btnDecipherPassword).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                decipherPassword();
            }
        });
        
//      --- back is pressed ------------
      findViewById(R.id.btnExitApp).setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
        	  finish();
          }
      });
    }
    
    private void cipherPassword () {
        Intent i = new Intent(this, EncryptActivity.class);
        startActivityForResult(i ,0);
    }
    
    private void decipherPassword () {
        Intent i = new Intent(this, DecryptActivity.class);
        startActivityForResult(i ,0);
    }
}